﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CategoryMenuItems.ascx.cs" Inherits="aspZone.Commerce.Web.App.Views.Shared.CategoryMenuItems" %>
<% foreach (var category in ViewData.Model) { %>
<li>
<% if (category.RenderLink) { %>
    <%= Html.ActionLink<CatalogController>(s => s.Category(category.Id, Html.Encode(category.UrlName)), category.Name)%>
<% } else { %>
    <p><%= Html.Encode(category.Name)%></p>
<% } %>
<ul class="<%= category.ShowChildren ? "expanded" : ""  %>">
    <% Html.RenderPartial("CategoryMenuItems", category.Children); %>
</ul>
</li>
<% } %>
